home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / science / ack3d.zip / ACKDATA.C < prev    next >
Text File  |  1994-01-09  |  3KB  |  86 lines

  1. /******************* ( Animation Construction Kit 3D ) ***********************/
  2. /*                 Global Data                     */
  3. /* CopyRight (c) 1993       Author: Lary Myers                     */
  4. /*****************************************************************************/
  5. #include <stdio.h>
  6. #include "ack3d.h"
  7. #include "ackeng.h"
  8.  
  9. /*****************************************************************************
  10.     The four variables below are used by ACKRAY and ACKVIEW and are somewhat
  11. misleading. They are held over from older versions of the engine where the
  12. accuracy of the ray-casting routine was still being determined. What happens
  13. is that LastX1 was a long and iLastX use to be an integer. It was later
  14. determined that they both needed to be longs to give better accuracy. The xRay
  15. routine use to set LastY1 to the Y value of an intersection and iLastX to the
  16. X value of the intersection with a wall. The yRay routine would set LastX1 and
  17. iLastY to the wall intersection.
  18. ******************************************************************************/
  19.     long        LastX1;
  20.     long        LastY1;
  21.     long        iLastX;
  22.     long        iLastY;
  23.  
  24.     int        MaxDistance;    /* Max dist achieved on last ray-cast */
  25.  
  26.     int        ErrorCode;        /* Global error set by various routines */
  27.  
  28.     int        xMapPosn;        /* Map posn of intersect by xRay routine */
  29.     int        yMapPosn;        /* map pons of intersect by yRay routine */
  30.  
  31.     UINT  far   *Grid;        /* Contains the wall map array */
  32.     UINT  far   *ObjGrid;        /* Holds object array when map read in */
  33.  
  34.     UCHAR far   *BitmapXferPtr; /* Used by XMS to hold real buffer ptr */
  35.     int        UseXMS;
  36.     XARRAY        xArray[MAX_XARRAY]; /* Holds current bitmaps in real mem */
  37.  
  38.     SPECIALCODE SpecialCodes[MAX_UPDOWN+1]; /* Special map codes */
  39.  
  40.     int        TotalSpecial;
  41.  
  42.     int        DistanceTable[MAX_DISTANCE+1];  /* Used in ray calc's */
  43.     long  far   *AdjustTable;        /* Used in object calc's */
  44.  
  45.     WALLARRAY   Walls[VIEW_WIDTH];        /* Walls in current POV */
  46.  
  47.     int        xSecretmPos;    /* Secret door currently opening */
  48.     int        xSecretmPos1;
  49.     int        xSecretColumn;
  50.  
  51.     int        ySecretmPos;    /* Secret door currently opening */
  52.     int        ySecretmPos1;
  53.     int        ySecretColumn;
  54.  
  55.     int        TotalSecret;
  56.     int        ViewColumn;
  57.  
  58.     long far    *SinTable;
  59.     long far    *CosTable;
  60.  
  61.     long far    *LongTanTable;
  62.     long far    *LongInvTanTable;
  63.     long far    *InvCosTable;
  64.     long far    *InvSinTable;
  65.     long far    *LongCosTable;
  66.     long far    *ViewCosTable;
  67.  
  68.     long far    *xNextTable;    /* Pre-calc'd amount of next X posn */
  69.     long far    *yNextTable;    /* Pre-calc'd amount of next Y posn */
  70.  
  71.     int        LastMapPosn;    /* Set for the calling application */
  72.     int        LastObjectHit;  /* Set for the calling application */
  73.     int        TotalObjects;
  74.  
  75. /* The following object variables are used when objects are found in the */
  76. /* current POV. They are built for later display of the objects.     */
  77.     UCHAR        ObjNumber[MAX_OBJECTS+1];
  78.     long        ObjRelDist[MAX_OBJECTS+1];
  79.     long        ObjDeltaX[MAX_OBJECTS+1];
  80.     long        ObjDeltaY[MAX_OBJECTS+1];
  81.  
  82.  
  83.     UCHAR        LightMap[GRID_MAX]; /* Not currently used */
  84.     UCHAR        WorkPalette[768];    /* Used for light shading */
  85.  
  86.